Test Series - java script

Test Number 85/92

Q: In which format does JavaScript support external JavaScript?
A. .js
B. .php
C. .js/php
D. .jss
Solution: JavaScript supports external JavaScript, in the form of .js file. This extension can be captured by a number of applications including: Windows Script Host, Dreamweaver MX, Notepad, Netscape Navigator, PavScrip, UltraEdit. The files are generally text files.
Q: What are the two parts of JavaScript libraries?
A. “script” tag and “body” tag
B. External JavaScript and the “script” tag
C. “html” tag and “body” tag
D. ”html” and “style” tag
Solution: All JavaScript libraries consists of two parts:
The external JavaScript itself, which is simply a text file with the containing JavaScript code, saved as a .js file.
A “script” tag referencing the external JavaScript file and defined on the page(s) that uses the library.
The 


Q: Which of the following attribute takes the source of the PHP file?
A. img
B. src
C. source
D. psrc
Solution: Php file is used an scripting language for backend development. The syntax to referencing a PHP file using external JavaScript is consistent enough with what we already know:
Q: What kind of path can the PHP file be?
A. Absolute
B. Relative
C. Either Absolute or Relative
D. Both Absolute and Relative
Solution: The PHP code is enclosed in special start and end processing instructions  that allows you to jump into and out of “PHP mode”. The PHP file is either an absolute or relative path to a PHP script instead of the usual .js file.
Q: Which of the following global variables is used to get parameters?
A. $HTTP_GET_VAR[]
B. $HTTP_GET_VARS()
C. $HTTP_GET_VARS
D. $HTTP_GET_VARS[]
Solution: The global variable $HTTP_GET_VARS[] is used to get parameters. $HTTP_GET_VARS contains the same initial information, but is not a superglobal.
Q: What is the purpose of the RegExp method test()?
A. Tests for a match in its float parameter
B. Tests for a match in its string parameter
C. Tests for a match in its integer parameter
D. Test for a match in node
Solution: RegExp stands for regular expression which is an object that describes a pattern of characters.
Q: What is the purpose of the function parameter filetype?
A. File type to be expected
B. File type previously got
C. File type that should not be got
D. File type available
Solution: The File.type property is an inbuilt function of File WebAPI which gives the media type (MIME) of the file represented by a file object. The function parameter “filetype” lets you tell the script what file type to expect before loading.
Q: Which of the following is the method used to add an element to the desired location?
A. add.element()
B. element.add()
C. element.appendChild()
D. addelement()
Solution: The method element.appendChild() is used to add the element to the desired location within the document tree. The appendChild() method appends a node as the last child of a node.

You Have Score    /10